package com.icloud.common.database.enums;

import lombok.Getter;

@Getter
public enum AppScreenLocationEnum {
    ALL("ALL"), // 不区分位置
    OTHER("OTHER"), // 默认在其他位置
    HOME("HOME"), // 主页
    SQUARE("SQUARE"); // 动态广场

    private final String code;

    AppScreenLocationEnum(String code){
        this.code = code;
    }

    public static AppScreenLocationEnum byCode(String code) {
        for (AppScreenLocationEnum e: AppScreenLocationEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
    public static boolean isHome(String code){
        return HOME.getCode().equalsIgnoreCase(code);
    }
    public static boolean isSquare(String code){
        return SQUARE.getCode().equalsIgnoreCase(code);
    }
}
